1994-1996 by Oberon microsystems, Inc., Switzerland.
All rights reserved. No part of this publication may be reproduced in any form or by any means, without prior written permission by Oberon microsystems. The only exception is the free electronic distribution of the education version of Oberon/F (see the accompanying
copyright
notice
for details).
Oberon/F module interfaces and their descriptions in particular may not be used in other works without written permission.
Oberon microsystems, Inc.
Technoparkstrasse 1
CH-8005 Z
Switzerland
Oberon is a trademark of ETH Z
rich, Switzerland.
Oberon/F, Oberon/L, "Oberon by Example", "The Oberon Tribune", "Oberon Developer Forum", and "Drag & Pick" are trademarks of Oberon microsystems, Inc.
All other trademarks and registered trademarks belong to their respective owners.
Form... creates dialogs and other forms that match exported global variables. All such forms are non
modal. Almost all dialogs in Oberon/F are non
modal, as long as the conventions for the underlying platform permit.
To get started, enter "TextCmds.find" into the link field of the Dev->New
Form... dialog. By clicking the default button, a dialog is automatically created which has fields find and replace, and buttons like FindNext and ReplaceAll. These fields and buttons directly match the record fields of variable find in module TextCmds. To verify this, select the string "TextCmds.find", and execute command Info->Interface. The browser will display the definition of the record type.
The size of a form view can be adjusted by selecting the whole document (Edit->Select
Document) and then dragging the graphical handles.
The dialog created by Dev->New
Form... exhibits a simple default arrangement of controls (e.g. buttons, text fields), shown as an editable layout. The controls may be re-arranged, renamed, or otherwise modified using the menus Layout and Controls. The former menu appears automatically whenever a form becomes focused.
Instead of creating an initial layout out of an existing global variable, form creation may start with an empty form (click on the New
Form dialog's Empty button), and then successively insert new controls via the Controls menu. Later, such controls may be linked to suitable global variables.
An edited dialog can be saved by saving the window of the form layout. Oberon/F saves dialogs in the standard document format. By convention, Oberon/F forms are saved in the appropriate Rsrc directory (-> Subsystems and Global Modules). For example, the standard Dev->Find
Replace dialog is stored in Text/Rsrc/Find.
Layout and Mask Modes
Forms can be used in two different modes. Normally, a form is used in layout mode, i.e. its layout can be freely edited. The views (e.g. controls) embedded in a form however, cannot be edited directly, because they can only be selected, but not focused. For layout editing, it would be very inconvenient if a click in one of the form's controls would focus it, instead of only selecting it. Forms are saved in layout mode, and opened in document windows.
For using a form as a dialog or data entry mask, a form can be opened in mask mode instead, in an auxiliary window (data entry mask) or in a tool window (dialog for the manipulation of a document beneath the dialog). A form in mask mode cannot be modified. However, its embedded views may be focused, e.g. a text entry field may be focused, or a button may be clicked. In contrast to layout mode, embedded views cannot be selected, resized, or moved around.
In mask mode, no focus border is shown around the currently focused view. In layout mode, a grid is shown.
Forms need not be saved in mask mode. They are saved in layout mode, and thus can be opened, edited, and saved again via the normal File menu commands. A data entry mask is opened via the StdCmds.OpenAuxDialog command; and a dialog is opened via the StdCmds.OpenToolDialog command, which open a form document into an auxiliary/tool window and forces it into mask mode. For example, the following commands show the difference between the two modes by opening the same (layout mode) form in the two possible ways:
"StdCmds.OpenAuxDialog('Form/Rsrc/New', 'History of Oberon')"
The latter two commands correspond to the File->Open command and allow editing.
The difference between auxiliary and tool dialogs is that auxiliary dialogs are self-contained, e.g. dialogs to set up configuration parameters or data entry masks. Tool dialogs on the other hand operate on windows below them, e.g. the Find
Replace dialog operates on the text beneath the dialog.
These OpenAuxDialog/OpenToolDialog commands accept portable path names as input. A portable path name is a string which denotes a file in a machine-independent way. It uses the "/" character as separator, i.e. like in Unix or the World-Wide Web.
These commands are usually applied in menu items, for example the following command sequence:
In this command sequence, the first command initializes the TextCmds.find interactor with the currently selected text stretch. The second command opens a dialog box with the Text/Rsrc/Find file's form, whose controls are linked to the interactor's fields upon opening of the dialog.
See also modules
FormGen
TextCmds
, and
StdCmds
Controls and Interactors
Controls are specialized views. Like every view, any control can be inserted into any general container, be it a text, a spreadsheet, or whatever other container is available. However, most controls are put into forms.
Each control can be linked to a variable, more exactly to the field of a globally declared record variable, a so-called interactor. When the control is allocated (newly created or read from a document), Oberon/F tries to link the control to its variable, using the advanced meta
programming capabilities of the Oberon/F core. In this way, the link between control and variable can be built up automatically when a dialog is created or loaded, and correct linking (i.e. correct typing) can be guaranteed even after a dialog layout had been edited. The separation of interactor from controls makes it possible to hide many user-interface details from a program, e.g. the layout of a dialog box or other "cosmetic" properties of controls.
Oberon/F provides command buttons, check boxes, radio buttons, fields, captions, list boxes, selection boxes, combo boxes, date, time, color, up/down fields, and groups as standard controls.
For more information on controls, see module
Controls
Control Properties
Controls have various properties, e.g. the string displayed in a button, or the interactor field to which the control is linked. The inspector is a tool used to inspect and to modify the properties of standard controls. To open the inspector dialog on a control, first select the control, and then execute Edit->Object
Properties... (Windows) / Edit->Component
Info (Mac OS).
To learn more about the inspector, see the documentation for module